/*
 *  standardTemplate.h
 *  allInOne
 *
 *  Created by James Johns on 01/11/2009.
 *  Copyright 2009 xD-Duncesoft. All rights reserved.
 *
 */


#ifndef STANDARD_TEMPLATE_H
#define STANDARD_TEMPLATE_H

#include "Core.h"

extern Core *coreContent;

#define MAX_COMMAND_COUNT 64

typedef void (*command_t)(char *parameters);

class standardTemplate {
public:
	standardTemplate();
	~standardTemplate();
	
	void run(int functionNumber, char *parameters);					// protocol for command execution
																	// <int functionNumber> references an entry in
																	// <command_t commandList[]>
																	// <char *parameters> is passed to 
																	// <commandList[]()>

/*	void registerCommand(const char *command);						// protocol for registering a command
																	// <const char *command> is passed to Core
																	// Uses <void Core::registerCommand();>
*/	
	int registerFunction(command_t function, const char *command);	// protocol for registering functionality
																	// to be ran from commandLine.
																	// <command_t function> is used in <void run()>
																	// and <const char *command> is is registered with
																	// <void Core::registerCommand()>
																	// returns:
																	// success				0x00
																	// general error		0xFF
																	// command list full	0xAA
	
	
	
	
	
private:
	int lastFunctionNumber;
	command_t commandList[MAX_COMMAND_COUNT];
};


#endif
